import redis
import sys
import os
import urllib3
import queue
import random
import string
import urllib.parse
# 最大线程数
MAX_WORKERS = 16

DEBUG = False 
DEBUG = True #本地调试


sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', buffering=1)  # 行缓冲
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

# 远程数据库推送地址
REMOTE_DB_PUSH_URL_LAST = "https://xf-162-test.lottefuture.com/api/weiboPush"
REMOTE_DB_PUSH_URL_NEXT = "https://xf-162.lottefuture.com/api/weiboPush"

if DEBUG:
    URLS=[
       REMOTE_DB_PUSH_URL_LAST,
       #REMOTE_DB_PUSH_URL_NEXT
    ]
else:
    URLS=[
        REMOTE_DB_PUSH_URL_LAST,
        REMOTE_DB_PUSH_URL_NEXT

    ]

#解析接口
PARSE_PRODUCT="http://cgi-bin.lottefuture.com/python/link-parse.php"
#没有解析出来的产品url
NO_PARSE_DEFAULT_URL="https://uland.taobao.com/coupon/edetail?itemId=prbDpZjUxt6z52MseAOIptm-9za58Xoh72J0DyWWHrR"




# 隧道域名:端口号
tunnel = "tun-festhu.qg.net:17690"

# 用户名密码方式
username = "E5F6D6EE"
password = "9B219197EE72"


PROXY = {
    "http": "http://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel},
    "https": "http://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel}
    }

#PROXY =None




if DEBUG:
    COOKIE_PATH = r"./weibo_cookies.json"
    URLS_PATH = './urls.txt'
    BLOCK_KEYWORD_PATH = './block_keyword.txt'
    JS_PATH='./pass_by_selenium/drag_captcha'
    DRIVER_PATH = "./chromedriver-ben/chromedriver.exe"
else:    
    COOKIE_PATH = r"./weibo_cookies.json"
    DRIVER_PATH = "./chromedriver-xian/chromedriver.exe"
    URLS_PATH = './urls.txt'
    BLOCK_KEYWORD_PATH = './block_keyword.txt'
    JS_PATH='./pass_by_selenium/drag_captcha'




